home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14600 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.spies.com!usenet
  2. From: Erik Max Francis <max@alcyone.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [HELP] ostream inheritance Q?
  5. Date: Sun, 31 Mar 1996 21:10:56 -0800
  6. Organization: Alcyone Systems
  7. Message-ID: <315F6560.6DA42610@alcyone.com>
  8. References: <4jf4lc$t8l@ground.cs.columbia.edu>
  9. NNTP-Posting-Host: newton.alcyone.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
  14.  
  15. Hyae-Jin Oh wrote:
  16.  
  17. >         however, this doesn't pass through Sun Sparc 3.1 CC compiler:
  18. > it generates lots of warning and one error. what am i doing wrong
  19. > here? other than this error, all others are working correctly.
  20. > many thanks.
  21.  
  22. The warnings:  It appears that the relevant member functions are not declared
  23. virtual in the base class.  This means that they are not virtual member
  24. functions, and will not override properly.  (These are just warnings.)
  25.  
  26. The error:  You have declared an Nostream::operator << member function which
  27. takes an argument which is a pointer a function returning a Nostream & and
  28. taking a const char *.  Your use of the identifier `msg' in the function
  29. pointer declaration is not a declaration, anymore than the identifier `msg'
  30. below is:
  31.  
  32.     Nostream &sample(const char *msg);
  33.  
  34. -- 
  35. Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
  36. San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
  37. H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
  38. Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
  39. "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
  40.